<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>date.日期</title>
</head>

<body>
    <script>
        var x = new Date();
        function gu() {
            var x1 = x.getFullYear();
            var x2 = x.getMonth() + 1;
            var x3 = x.getDate();
            var x4 = x.getDay();
            var s = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
            var y=s[x4];
            var x5=x.getHours();
            var x6=x.getMinutes();
            var x7=x.getSeconds();
            document.write('今天是'+x1+'年'+x2+'月'+x3+'日'+y+'<br>'+x5+':'+x6+':'+x7);
        }
        gu();
    </script>
</body>

</html>